package com.wjh.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author: 王金海
 * @Description:
 * @Date: Created by Administrator on 2018/6/26.
 * @Modified By:
 */
public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016091300503052";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC1/qm8YvsuYzFIWWXKqPRTSXAEWeE3xw0K3vT4pQhj6UoJ+KFDhNyiKEDV1unwzpvGYWDiOD9Pu+3uS8QJKW5+xP7w6a8pqTIUltZHQGBMOnqJgqTWq6BMbkGxEqgpD8vNxmseO7asG7nSzZA7fGZ4SLB/78KAUYul/C7dhccn83XI5zXRolgT1Bet6OHjk1lcXNy1XGZG0GMXIwO599ylgXzl4GcKomcgBMRt7jwxTfGIKKxki4IS/6ldXKuuTInndUq4w609leR7jw9kmYjdRHJfeycEQKeQ+XNB5uSlpK1afvGQ30AId9pKhokusB+VHMl4aktoW2wGs6onBqipAgMBAAECggEBAJSe/d/A+Rydlm5dyvmf1b56F0cGWxxgqe75uhWfN+XXakYQSylHQ6IMuz2lvu+O2bk8ZpD2nAUyFBBowRM2SWyu1P7J5uhfqm0T7LLNCJbXnp/TF2fTShmAZJcFBFxb8PP/GBTdcMTF848JncJmSYvq2G/xzOVbMm5/LYprqAKftrz5BbECh6BPZFRlDn7k1zVUemXPsvkO0StmKWlCQbuSHVDcEfotY/MiXWrpT1+Mp9ORD5VTv7TcrEeVQOp2mj7x97/B12q+LigwTQ1i1fe0xXH9WZjZsfxOqBTpm7/doNgansBeZgjGiSKWomhnWOetXvRdze+jVrvRzA7hzgECgYEA4/G5SyPIuuUikY8NTGTWCthy4HzcWuVXBZ6vnoFQhud00Ahw8tlyl46nRWOM1EGKbfBqCAs2bOsBMVad+zS3BbQx7ijo4WKRJv06Ur67fRI9+qjQN0V10Gp1pQrs4tdpldgDwe0s0NC4zQKPP6lAOo//+/PsVcdSS35A+/fby2kCgYEAzGUfH5jdTIWFTH3lcCz2NXuz1steHMdpu2elMOJ6e0TBDRKU0AbFY+lKjTKsA+rdjYMpmNB/kXQRCrr70XKqM3RoEgit4T01TldPoIwYYJb0egtPXvAizpaXJcQ02AaLGrJZyN/Bic/1kqoHzdo1cMyBSwsdoE5tCPvbqT/Wi0ECgYA6XpXCRgGKyk4V0/nlzBR7Zn3UOmT66atlBwOVpSuHwBFLjD3QEhqj8KWowRs45yeZi2y7bpObRHpjtfhycUdEsKXwhI1N2b2trD6ZHbpJBrjUTRI0dRb8Laa+gpOyatLgyhX8PM2zEx+fb75a4O5PkLxOOmIUfRv3tPbTDt87sQKBgFQdATPlmpyVDggufy8ssZ3M7HNmebJqNg7TVl3JthHod3HDxc3eG3lEVlPJGJT8IHTOF14132miVCkQTfUhtP072GAjhjr9D2TP9YriXF3TgYSABwfQ1uIhgs4d8ok8GB7CasSJoIHwPOVAZ7nFJNzorASP7H8+Bwz9aKY8CTSBAoGAdFs75z2MPbjb4E8HWUlp9trgPyERaImx7r+fZ0qLqDwBd+fhUyZyQfLaVg0T6H9G8QX2x8jNdTZqjiue4OdXfj0BQg/KsmkMDfZ8HMjvfmoXe8OtC7LHt2aB44jl3Y5k5gGAv5Gjfm45DrTMJvvL4QW1W4AnblDYuUPzNTf59Dw=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA23unto8IQbonn/DbDjL2LUG5qQ5//USdO0LGxRHHDxPjDwoLis1Flxr0A+RG19jNl/6/7cFz36ALglpe4Y0cBehmPCQkh84jpBMVz8+rXMIcTTF/iEwSywAcsjrB9ANOtowQ+YeTyesmFDVQoh6DDk5fJeMXUajCX/uNlFmZz6MvLsRlDHFv6kve8myw8sgV/TbWdeQLVltm1d/F2SWBmxGODq9sVH119VZb5uecLKsanDcve6tqAK89xI0NzIlS5H/7IKPpbaIpm4ypI9xE8CH7HOMYxkcpHLeqL2TlvIrwiqDAjVLGhtKoFch33Wj2SxibKgsW2a8IfXFr12ms5wIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://wangjinhai.nat300.top/callBack/asynCallBack";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://wangjinhai.nat300.top/callBack/synCallBack";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
